home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / pkb.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.4 KB  |  98 lines

  1. /**/
  2.  
  3. call rxmuiopt("debugmode showerr")
  4. call setrxmuistack(128000)
  5.  
  6. signal on halt
  7. signal on break_c
  8.  
  9. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  10. if AddLibrary("rxmui.library")~=0 then exit
  11.  
  12. call createApp
  13. call SetNotifies
  14.  
  15. call set("win","open",1)
  16. call getattr("win","open","o")
  17. if o=0 then do
  18.     say "can't open window"
  19.     exit
  20. end
  21.  
  22. call handleApp
  23. exit
  24. /***********************************************************************/
  25. handleApp: procedure
  26.     ctrl_c=2**12
  27.     do forever
  28.         call newhandle("app","h",ctrl_c)
  29.         if and(h.signals,ctrl_c)>0 then exit
  30.         select
  31.             when h.event="QUIT" then exit
  32.             otherwise nop
  33.         end
  34.     end
  35.  
  36. /***********************************************************************/
  37. err: procedure expose sigl rxmuierror
  38. parse arg res
  39. say sigl "["res"]"
  40.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  41.     exit
  42. /***********************************************************************/
  43. createApp: procedure
  44.     app.Title="Keyboard"
  45.     app.Version="$VER: Keyboard 1.0 (10.12.99)"
  46.     app.Copyright="©1999, alfie"
  47.     app.Author="alfie"
  48.     app.Description="Keyboard example"
  49.     app.Base="KEYBOARD"
  50.     app.SubWindow="WIN"
  51.      win.ID="MAIN"
  52.      win.Title="Keyboard Example"
  53.      win.Contents="MGROUP"
  54.  
  55.       mgroup.0="g"
  56.        g.class="group"
  57.  
  58.         g.0="spkb1"
  59.          spkb1.class="Scrollgroup"
  60.          spkb1.VirtgroupContents="pkb1"
  61.          spkb1.FreeVert=0
  62.           spkb1.0="pkb1"
  63.            pkb1.class="pkb"
  64.            pkb1.PkbOctvStart=1
  65.            pkb1.PkbOctvRange=11
  66.            pkb1.PkbOctvName=1
  67.            pkb1.PkbOctvBase=-2
  68.            pkb1.PkbExcludeHigh=4
  69.  
  70.         g.1="spkb2"
  71.          spkb2.class="Scrollgroup"
  72.          spkb2.FreeVert=0
  73.          spkb2.VirtgroupContents="pkb2"
  74.            pkb2.class="pkb"
  75.            pkb2.PkbOctvStart=1
  76.            pkb2.PkbOctvRange=11
  77.            pkb2.PkbOctvName=1
  78.            pkb2.PkbOctvBase=-2
  79.            pkb2.PkbExcludeHigh=4
  80.            pkb2.PkbType="Small"
  81.  
  82.     res=NewObj("APPLICATION","APP")
  83.     if res~=0 then call err(res)
  84.  
  85.     return
  86. /***********************************************************************/
  87. setNotifies: procedure
  88.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  89.     if res~=0 then call err(res)
  90.  
  91.  
  92.     return
  93. /***********************************************************************/
  94. halt:
  95. break_c:
  96.     exit
  97. /**************************************************************************/
  98.